package dk.dashboardFP.panels.tempPanel {
	import dk.dashboardFP.panels.panelElements.DashboardFPPanelEvent;
	import dk.dashboardFP.uiElements.TitleBarButtonEvent;
	import dk.dashboardFP.uiElements.TitleBarButton;
	import dk.dashboardFP.core.DashboardFPCore;
	import dk.dashboardFP.panels.panelElements.AbstractDashboardFPPanel;

	/**
	 * @author josef
	 */
	public class AstractTempPanel extends AbstractDashboardFPPanel {
		public function AstractTempPanel(doDashboardFPCore : DashboardFPCore, sPanelName : String) {
			super(doDashboardFPCore, sPanelName);
		}

		override protected function setup() : void {
			
			super.setup();
			
			//:::::::
			// add close button to ui and register 
			_doPanelUI.doTitleBar.addTitleBarButton(new TitleBarButton(1, TitleBarButtonEvent.REQUEST_CLOSE));
			_doPanelUI.addEventListener(TitleBarButtonEvent.REQUEST_CLOSE, onCloseRequested, false, 0, true);
		}

		private function onCloseRequested(event : TitleBarButtonEvent) : void {
			dispatchEvent(new DashboardFPPanelEvent(DashboardFPPanelEvent.REQUEST_CLOSE));
		}
	}
}
